home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Prefs
/
MPPPListLV.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-09-17
|
4KB
|
147 lines
#include "mpp.h"
#include <graphics/rpattr.h>
#include <extras/ext_text.h>
LONG FillShinePen,FillShadowPen;
ULONG __saveds __asm PromotionLVFunc(register __a0 struct Hook *Hook,
register __a1 struct LVDrawMsg *Dm,
register __a2 struct DefaultNode *DN)
{
struct RastPort *rp;
LONG top,bottom,left,right,baseline;
LONG fgpen,bgpen;
ULONG state,selected;
if(Dm->lvdm_MethodID!=LV_DRAW)
return(LVCB_UNKNOWN);
left =Dm->lvdm_Bounds.MinX;
top =Dm->lvdm_Bounds.MinY;
right =Dm->lvdm_Bounds.MaxX;
bottom=Dm->lvdm_Bounds.MaxY;
rp=Dm->lvdm_RastPort;
state=Dm->lvdm_State;
if(LVR_SELECTED == state || LVR_SELECTEDDISABLED == state)
{
fgpen=Dm->lvdm_DrawInfo->dri_Pens[FILLTEXTPEN];
bgpen=Dm->lvdm_DrawInfo->dri_Pens[FILLPEN];
selected=1;
}
else
{
fgpen=Dm->lvdm_DrawInfo->dri_Pens[TEXTPEN];
bgpen=Dm->lvdm_DrawInfo->dri_Pens[BACKGROUNDPEN];
selected=0;
}
SetAPen(rp,bgpen);
RectFill(rp,left,top,right,bottom);
baseline=rp->Font->tf_Baseline+top;
if((DN->Flags & DNF_NEVER_PROMOTE))
{
LONG shine,shadow;
if(selected && FillShinePen!=-1 && FillShadowPen!=-1)
{
shine=FillShinePen;
shadow=FillShadowPen;
}
else
{
shine=Dm->lvdm_DrawInfo->dri_Pens[SHINEPEN];
shadow=Dm->lvdm_DrawInfo->dri_Pens[SHADOWPEN];
}
SetRPAttrs(rp,
// RPTAG_APen ,Dm->lvdm_DrawInfo->dri_Pens[SHINEPEN],
RPTAG_APen ,shine,
RPTAG_DrMd ,JAM1,
TAG_DONE);
gui_RenderText(rp, DN->Def_Node.ln_Name,
RT_XPos ,left+2,
RT_Baseline ,baseline+1,
RT_MaxWidth ,right-left-4,
TAG_DONE);
SetRPAttrs(rp,
// RPTAG_APen ,Dm->lvdm_DrawInfo->dri_Pens[SHADOWPEN],
RPTAG_APen ,shadow,
TAG_DONE);
gui_RenderText(rp, DN->Def_Node.ln_Name,
RT_XPos ,left+1,
RT_Baseline ,baseline,
RT_MaxWidth ,right-left-4,
TAG_DONE);
}
else
{
if(DN->Flags & DNF_UNAPPROVED)
{
SetRPAttrs(rp,
RPTAG_APen ,fgpen,
RPTAG_DrMd ,JAM1,
TAG_DONE);
gui_RenderText(rp, DN->Def_Node.ln_Name,
RT_XPos ,left+1,
RT_Baseline ,baseline,
RT_MaxWidth ,right-left-4,
TAG_DONE);
gui_RenderText(rp, DN->Def_Node.ln_Name,
RT_XPos ,left+3,
RT_Baseline ,baseline,
RT_MaxWidth ,right-left-4,
TAG_DONE);
gui_RenderText(rp, DN->Def_Node.ln_Name,
RT_XPos ,left+2,
RT_Baseline ,baseline-1,
RT_MaxWidth ,right-left-4,
TAG_DONE);
gui_RenderText(rp, DN->Def_Node.ln_Name,
RT_XPos ,left+2,
RT_Baseline ,baseline+1,
RT_MaxWidth ,right-left-4,
TAG_DONE);
SetRPAttrs(rp,
RPTAG_APen ,bgpen,
RPTAG_DrMd ,JAM1,
TAG_DONE);
gui_RenderText(rp, DN->Def_Node.ln_Name,
RT_XPos ,left+2,
RT_Baseline ,baseline,
RT_MaxWidth ,right-left-4,
TAG_DONE);
}
else // Render normally
{
SetRPAttrs(rp,
RPTAG_APen ,fgpen,
RPTAG_DrMd ,JAM1,
TAG_DONE);
gui_RenderText(rp, DN->Def_Node.ln_Name,
RT_XPos ,left+1,
RT_Baseline ,baseline,
RT_MaxWidth ,right-left-2,
TAG_DONE);
}
}
if(LVR_NORMALDISABLED == state || LVR_SELECTEDDISABLED == state )
gui_GhostRect(rp,Dm->lvdm_DrawInfo->dri_Pens[TEXTPEN],left,top,right,bottom);
return(LVCB_OK);
}